package com.itboye.ihomebank.adapter;

import java.util.List;

import android.annotation.SuppressLint;
import android.content.Context;
import android.view.Gravity;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Toast;

import com.itboye.ihomebank.R;
import com.itboye.ihomebank.bean.HouseListBeanCopy.HouseTag;
import com.itboye.ihomebank.bean.HouseListBeanCopy.Rental;
import com.itboye.ihomebank.support.commonadapter.MutiplyCommonAdapter;
import com.itboye.ihomebank.support.commonadapter.ViewHolder;

/***
 * 示例adapter
 * 
 * @author mr.w
 * 
 */
public class TeSeAdapter extends MutiplyCommonAdapter<HouseTag> {

	int position;

	public TeSeAdapter(Context context, List<HouseTag> datas, int... layoutId) {
		super(context, datas, layoutId);
		// TODO Auto-generated constructor stub
	}

	@Override
	public int getItemViewType(int position) {
		// TODO Auto-generated method stub

		return 0;
	}

	public void setCurrentItem(int position) {
		this.position = position;
		notifyDataSetChanged();
	}

	int color = 0xFF6183EF;

	@SuppressLint("ResourceAsColor")
	@Override
	public void convert(ViewHolder holder, HouseTag t, int type,
			final int position) {
		// TODO Auto-generated method stub

		holder.setText(R.id.text, t.getName());
		holder.setTextColor(R.id.text, R.color.black);
		holder.setBackgroundRes(R.id.text, R.drawable.btn_border_gray_unselect);
		if (position == this.position) {
			holder.setTextColor(R.id.text, color);
			holder.setBackgroundRes(R.id.text,
					R.drawable.btn_border_blue_selected);
		}
	}

	@Override
	public void getItemPosition(int position) {
		// TODO Auto-generated method stub
		this.position = position;
	}

}
